#include<bits/stdc++.h>
using namespace std;
using ll = long long ;

int main() {//sqrt(n)
    int main() {//sqrt(n)
    ll n;
    cin >> n;
    for (ll a = sqrt(2 * n); a > 1; a--) {
        if((2 * n) % a)continue;
        ll b = 2 * n / a;
        //a<=b (q-p+1)=a && (p+q)=b
        ll p = (b - a + 1) / 2;
        ll q = (a + b - 1) / 2;
        if(p != q && (p + q) * (q - p + 1) == 2*n) {
            cout << p << " " << q << endl;
        }
    }


    return 0;
}